import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
{
  path:'/',
  redirect: '/index/recommend'
},
  {
    path: '/index/:firstPage',
    name: 'Home',
    component: Home,
    meta: {
      parentId: 1
    },
    // children: [
    //   {
    //     path: '/backend',
    //     meta: {
    //       parentId: 1
    //     },
    //     component: () => import('../views/Backend.vue'),
    //   },
    //   {
    //     path: '/frontend',
    //     meta: {
    //       parentId: 1
    //     },
    //     component: () => import('../views/Frontend.vue'),
    //   },
    //   {
    //     path: '/android',
    //     meta: {
    //       parentId: 1
    //     },
    //     component: () => import('../views/Android.vue'),
    //   }
    // ]
  },
  {
    path: '/pins',
    name: 'About',
    meta: {
      parentId: 2
    },
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  },
  {
    path: '/detail',
    component: () => import('../views/Detail.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
